home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
SELUSRPR.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
4KB
|
128 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_SelectUsrPrint( cPrintType ) --> NIL
PARAMETERS:
cPrintType: Print Type to set
SHORT:
Set various printer settings for printers defined in PRINTDEF.DAT.
DESCRIPTION:
_SetUsrPrint() and _SelUsrPrint() are responsible for creating (if necessary)
and maintaining two databases that store information on printer setup codes,
and default printers for users.
The first database, PRINTDEF.DAT, contains printers and their respective
setup codes for various print attributes. On the first call to either
_SetUsrPrint() or _SelUsrPrint(), if the PRINTDEF.DAT database does not
exist, it is created with three predefined printer drivers: HP LaserJet,
Epson FX/MX/LQ, and IBM Proprinter II.
Valid Print Settings are:
COMPRESS : Compress Print
BOLD : Bold Print
UNDERLINE : Underline Print
RESET : Reset Print Codes to Default
CUSTOM_1 : Custom
CUSTOM_2 : Custom
CUSTOM_3 : Custom
CUSTOM_4 : Custom
Each printer driver record contains the following fields:
PRINT_NUM : Printer Number
PRINT_NAME : Printer Name
COMPRESS : Code for Condensed Print
BOLD : Code for Bold Print (Double Strike for Dot matrix)
RESET : Reset Code
CUSTOM_1 : Custom Code Slot 1
CUSTOM_2 : 2
CUSTOM_3 : 3
CUSTOM_4 : 4
The CUSTOM fields can be used to carry printer codes that are specific to the
particular printer. I.E., Landscape is only applicable to Laser Printers,
and Underline is not a part of any normal selectable font on most dot matrix
printers. For that reason, these codes can be set in the CUSTOM_X fields and
selected in the calling application.
For instance, to use LANDSCAPE on the HP LaserJet, request CUSTOM_2. You
might want to use the Clipper Preprocessor to make this clear:
#define HP_UNDERLINE 'CUSTOM_2'
_SelUsrPrint(HP_UNDERLINE)
On the first call to either _SetUsrPrint() or _SelUsrPrint(), if the
PRINTDEF.DAT file does not exist, it is created with three predefined printer
drivers.
The Custom Fields available for these are:
HP LaserJet:
Custom_1: Portrait
Custom_2: Landscape
Custom_3: Underline
Epson FX/MX/LQ:
Custom_1: Near Letter Quality
Custom_2: Italics
IBM ProPrinter II / IBM Graphics:
Custom_1: Near Letter Quality
The SECOND database is USERPRIN.DAT. This database contains only two fields:
USER_NAME: User Name as set in DOS Environment Variable U_NAME
PRINTER : Number of Selected Printer.
The PRINTER number is used to relate each user to their selected printer
driver. U_NAME MUST be set as a DOS Environment Variable BEFORE the program
starts:
SET U_NAME=PKWALLACE
When the _SetUsrPrint() function is called, a pick-box is presented with the
three default printer names and any others that have been specifically added.
The user picks one from the list.
_SetUsrPrint() then saves the user name (U_NAME) and the printer number in
the USERPRIN.DAT database.
When _SelUsrPrint() is called, the user name (U_NAME) is located in the
USERPRIN.DAT database, the printer number is retrieved and used as a select
into the PRINTDEF.DAT database to retrieve the code for the correct printer.
All Characters AFTER the first SPACE in the printer code fields are ignored
(allowing comments). (i.e., "<ESC>E This is a Reset")
NOTE:
EXAMPLE:
_SetUsrPrint(10,10,15,45,'w+/n')
_SelUsrPrint('COMPRESS')
Result: _SetUsrPrint() records the printer number of the printer selected
from the pick list (whatever it is).
_SelUsrPrint() then sets compressed print from the COMPRESS field from
the record that contains the user number of the printer selected
by _SelUsrPrint().
******************************************************************************/